package defectsim;

import repast.simphony.engine.schedule.ScheduledMethod;

public abstract class DefectAgent implements Located{

	private double locationX;
	private double locationY;
	private int locationGridX;
	private int locationGridY;
	private DefectFactory.DefectType defectType;
	
	public void setX(double x){
		locationX = x;
	}
	
	public void setY(double y){
		locationY = y;
	}

	public void setLocationGridX(int locationGridX) {
		this.locationGridX = locationGridX;
	}

	public void setLocationGridY(int locationGridY) {
		this.locationGridY = locationGridY;
	}

	public DefectFactory.DefectType getDefectType() {
		return defectType;
	}

	public void setDefectType(DefectFactory.DefectType defectType) {
		this.defectType = defectType;
	}

	public abstract void percept();
	public abstract void mentalUpdate();
	public abstract void act();
	
	@ScheduledMethod(start = 1, interval = 1)
	public void step(){
		percept();
		mentalUpdate();
		act();
	}

	@Override
	public double getX() {
		return locationX;
	}

	@Override
	public double getY() {
	 	return locationY;
	}
	
	@Override 
	public int getGridX(){
		return locationGridX;
	}
	
	@Override 
	public int getGridY(){
		return locationGridY;
	}
}
